/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, { Component } from 'react';
import {
    AppRegistry,
    StyleSheet,
    Text,
    View,
    Image,
    TextInput,
} from 'react-native';

var Dimensions = require('Dimensions');
//定义一些全局变量
var {width} = Dimensions.get('window');

class loginView extends Component {
    render() {
        return (
            <View style={styles.container}>
                {/*头像*/}
                <Image style={styles.pic} source={{uri: 'http://blog.duicode.com/wp-content/uploads/2016/12/icon_user_monkey_i6@2x.png'}}>
                </Image>
                {/*账号密码*/}
                <TextInput style={styles.textInputStyle} placeholder={'请输入用户名'} />
                <TextInput style={styles.textInputStyle} placeholder={'请输入密码'} password={true} />
                {/*登录*/}
                <View style={styles.loginBtnStyle}>
                        <Text style={{color:'white'}}>登录</Text>
                </View>
                {/*设置*/}
                <View style={styles.settingStyle}>
                    <Text style={{color:'green'}}>无法登陆</Text>
                    <Text style={{color:'green'}}>新用户</Text>
                </View>
                {/*其他登录方式*/}
                <View style={styles.otherLoginStyle}>
                    <Text>其他登录方式:</Text>
                    <Image style={styles.img} source={require('./phone.png')}></Image>
                    <Image style={styles.img} source={require('./phone.png')}></Image>
                    <Image style={styles.img} source={require('./phone.png')}></Image>
                </View>
            </View>
        );
    }
}

const styles = StyleSheet.create({
    container: {
        flex: 1,
        backgroundColor: '#dddddd',
        alignItems:'center',
    },
    pic: {
        width:80,
        height:80,
        borderRadius:40,
        borderWidth:4,
        borderColor:'white',
        marginTop:50,
        marginBottom:30,
    },
    username:{

    },
    password:{

    },
    textInputStyle:{
        height:44,
        backgroundColor:'white',
        marginBottom:1,
        textAlign:'center',
    },
    loginBtnStyle:{
        height:44,
        width:width - 40,
        backgroundColor:'blue',
        marginTop:30,
        marginBottom:20,

        justifyContent:'center',
        alignItems:'center',

        borderRadius:5,
    },
    settingStyle:{
        flexDirection:'row',
        justifyContent:'space-between',
        width:width - 40,

    },
    otherLoginStyle:{
        // backgroundColor:'red',
        flexDirection:'row',
        alignItems:'center',

        //绝对定位
        position:'absolute',
        bottom:10,
        left:20,

    },
    img:{
        width:40,
        height:30,
        marginLeft:5,
    }
});

//输出类
module.exports = loginView;
